<template>
  <div>
    <FilterTable
      ref="table"
      :columns="columns"
      height="auto"
      :params="fetchParams"
      :datakey="'records'"
      :isPagination='false'
      :isToperInfo='false'
      :isColumnFilter='false'
      :isSelectColumn='false'
      selectionType="single"
      :onRowSelectChange="selectChangeHandle"
      :onColumnsChange="columns => this.columns = columns"
    ></FilterTable>
  </div>
</template>

<script>
import {
  queryPotenCusManage
} from '@/api/potenCus/customer/potenCusManage';
import { dictionary } from '@/utils/dictMixin';

export default {
  name: 'allotDialog',
  mixins: [dictionary],
  props: {
    type: {
      type: String,
      default: 'allot'
    },
    rowData: {
      type: Object,
      default: () => ({})
    }
  },
  data() {
    this.saveData = null;
    return {
      fetchParams: {},
      // fetchApi: queryPotenCusManage,
      columns: this.createTableColumns(),
      handleType: '',
      formData: {},
      conf: { add: '新增' },
    };
  },
  created() {
    // this.init();
    // this.getDictBrandList()
  },
  methods: {
    // init() {
    //   if (this.type === 'edit' || this.type === 'show') {
    //     // 更新接口需要的记录 ID
    //     this.recordId = this.rowData.clueRecordId;
    //     this.formList1.forEach(x => {
    //       x.initialValue = this.rowData[x.fieldName];
    //     });
    //   }
    // },
    selectChangeHandle(rows) {
      if (!rows.length) return;
      this.selectedRow = rows[0];
    },
    createTableColumns() {
      return [
        {
          title: '序号',
          dataIndex: 'index',
          width: 80,
          sorter: true,
          render: props => {
            return <span>{props.row.index + 1}</span>;
          }
        },
        {
          title: '发生时间',
          dataIndex: 'potentialCustomerPhone',
          sorter: true,
          filter: true,
          filterType: 'input'
        },
        {
          title: '操作人员',
          dataIndex: '1',
          sorter: true,
          filter: true,
          filterType: 'input'
        },
        {
          title: '发生事项',
          dataIndex: '2',
          sorter: true,
          filter: true,
          filterType: 'input'
        },
        {
          title: '备注',
          dataIndex: '3',
          sorter: true,
          filter: true,
          filterType: 'input'
        }
      ];
    },

  }
};
</script>

<style lang="less" scoped>
</style>

